\newproblem{lay:6_5_24}{
  % Problem identification
	\begin{large}
	  \hspace{\fill}\newline
    \textbf{Lay, 6.5.24}
	\end{large}
	\\
  \ifthenelse{\boolean{identifyAuthor}}{\textit{Carlos Oscar Sorzano, Aug. 31st, 2013} \\}{}

  % Problem statement
	Find a formula for the least-squares solution of $A\mathbf{x}=\mathbf{b}$ when the columns of $A$ are orthonormal.
}{
   % Solution
	The standard solution of the least-squares problem is
	\begin{center}
		$\hat{\mathbf{x}}=(A^TA)^{-1}A^T\mathbf{b}$
	\end{center}
	Consider the column decomposition of $A$ and its implications in the computation of $A^TA$
	\begin{center}
		$A=\begin{pmatrix}\mathbf{a}_1 & \mathbf{a}_2 & ... & \mathbf{a}_n\end{pmatrix}$\\
		$A^T=\begin{pmatrix}\mathbf{a}_1^T \\ \mathbf{a}_2^T \\ ... \\ \mathbf{a}_n^T\end{pmatrix}$\\
		$A^TA=\begin{pmatrix}\mathbf{a}_1^T \\ \mathbf{a}_2^T \\ ... \\ \mathbf{a}_n^T\end{pmatrix}\begin{pmatrix}\mathbf{a}_1 & \mathbf{a}_2 & ... & \mathbf{a}_n\end{pmatrix}=
		   \begin{pmatrix}\mathbf{a}_1^T\mathbf{a}_1 & \mathbf{a}_1^T\mathbf{a}_2 & ... & \mathbf{a}_1^T\mathbf{a}_n \\
			                \mathbf{a}_2^T\mathbf{a}_1 & \mathbf{a}_2^T\mathbf{a}_2 & ... & \mathbf{a}_2^T\mathbf{a}_n \\
											... & ... & ... & ...\\
											\mathbf{a}_n^T\mathbf{a}_1 & \mathbf{a}_n^T\mathbf{a}_2 & ... & \mathbf{a}_n^T\mathbf{a}_n\end{pmatrix}$
	\end{center}
	Since the columns of $A$ are orthonormal all products $\mathbf{a}_i^T\mathbf{a}_j$ with $i\neq j$ are equal to 0 and the products $\mathbf{a}_i^T\mathbf{a}_i$ are equal to 1.
	Thus, we have
	\begin{center}
		$A^TA=\begin{pmatrix}1 & 0 & ... & 0 \\
			                0 & 1 & ... & 0 \\
											... & ... & ... & ...\\
											0 & 0 & ... & 1\end{pmatrix}$
	\end{center}
	Then $(A^TA)^{-1}A^T=A^T$. Finally, the least-squares solution is
	\begin{center}
		$\hat{\mathbf{x}}=(A^TA)^{-1}A^T\mathbf{b}=\begin{pmatrix}\mathbf{a}_1^T \\ \mathbf{a}_2^T \\ ... \\ \mathbf{a}_n^T\end{pmatrix}\mathbf{b}=
											\begin{pmatrix}\mathbf{a}_1^T\mathbf{b} \\ \mathbf{a}_2^T\mathbf{b} \\ ... \\ \mathbf{a}_n^T\mathbf{b}\end{pmatrix}$
	\end{center}
	which is nothing more than the orthogonal projection of the vector $\mathbf{b}$ onto each one of the orthonormal columns of $A$.
}
\useproblem{lay:6_5_24}
\ifthenelse{\boolean{eachProblemInOnePage}}{\newpage}{}

